package com.example.a22310.yuejian09.Fragment;


import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.TextView;
import android.widget.Toast;

import com.example.a22310.yuejian09.R;

/**
 * A simple {@link Fragment} subclass.
 */
public class LeagueFragment extends Fragment {

    private  TextView tvinfo;
    private  View view=null;
    private Context context;

    private ImageButton btn_club;
    private ImageButton btn_train;
    private ImageButton btn_league;
    private ImageButton btn_print;
    private ImageButton btn_personal;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        context = getActivity();
        view = inflater.inflate(R.layout.fragment_league,container,false);
        tvinfo = (TextView)view.findViewById(R.id.textView7);
        tvinfo.setText("主页");
        Toast.makeText(context,"加载fragment主页",Toast.LENGTH_SHORT).show();
        init();
        initEvent();
        return view;
    }



    private void init() {
        btn_club = (ImageButton)view.findViewById(R.id.btn_club);
    }
    private void initEvent() {
        btn_club.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(),ClubFragment.class);
                startActivity(intent);
            }
        });
    }


}
